package edu.neu.springcloud.service;

import edu.neu.springcloud.dao.FactoryDao;
import edu.neu.springcloud.entity.Commodity;
import edu.neu.springcloud.entity.Factory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FactoryService {
    @Autowired
    private FactoryDao factoryDao;

    public List<Factory> list(Long id, String name) {
        Factory queryLimitCommodity = new Factory().setId(id).setName(name);
        return factoryDao.list(queryLimitCommodity);
    }

    public boolean add(Factory factory) {
        return factoryDao.add(factory);
    }

    public boolean update(Factory factory) {
        return factoryDao.update(factory);
    }

    public boolean delete(Long id) {
        return factoryDao.delete(id);
    }
}
